//
//  VipPrivilegeModel.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/8/10.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class VipPrivilegeModel: NSObject {
    var avator = "-999"
    var signin_bean = "-999"
    var can_signin = "-999"
    var gold = "-999"
    var share_data : ShareContentModel?
    var bean = "-999"
    var authentic_gold = "-999"
    var can_authentic = "-999"
    var invite_bean = "-999"
    var nickname = "-999"

    init(dic : [String : AnyObject]) {
        super.init()
        
        setValuesForKeys(dic)
        
    }
    
    
    override func  setValue(_ value: Any?, forKey key: String) {
        
        if key == "share_data" {
            
            if let temp = value as? [String : AnyObject]{
                
                share_data = ShareContentModel(dic:temp )
                
            }
            
        } else {
            
            
            super.setValue(value, forKey: key)
        }
        
    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
        
    }
    
    
    //在swift中想要打印对象要以下重写属性
    override var description: String{
        let keys = ["avator","signin_bean","nickname","can_signin","gold","bean","authentic_gold","can_authentic","invite_bean","share_data"]
        let dic = dictionaryWithValues(forKeys: keys)
        return "\(dic)"
    }

}
